package cn.hd01.repository.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
@Table(name = "rebate_summary")
public class RebateSummary {
	@Id
	@GeneratedValue
	private Integer id;

	private Integer refId;

	private String name;

	private String type;

	private BigDecimal allRebate;

	private BigDecimal allWaitWithdrawRebate;
	
	private BigDecimal allWithdrawRebate;

	private Date createTime = new Date();

	private Date updateTime = new Date();
	
	@OneToOne(targetEntity = DistributorDetails.class)
	@JoinColumn(name="refId", referencedColumnName="distributorId", nullable=true, insertable=false, updatable=false)
	@NotFound(action=NotFoundAction.IGNORE)
	private DistributorDetails distributorDetails;
	
	/**
	 * 自身的订单总金额
	 */
	@Transient
	private BigDecimal amount;
	
	/**
	 * 下级的订单总金额
	 */
	@Transient
	private BigDecimal otherAmount;
	
	@Transient
	private BigDecimal otherAllWaitWithdrawRebate;
	
	@Transient
	private BigDecimal otherAllWithdrawRebate;
	
	@Transient
	private BigDecimal allAmount;
	
	@Transient
	private String shopName;
	
	@Transient
	private BigDecimal allKValue;
	
	@Transient
	private String beginDate;
	
	@Transient
	private String endDate;
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getRefId() {
		return refId;
	}

	public void setRefId(Integer refId) {
		this.refId = refId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public BigDecimal getAllRebate() {
		return allRebate;
	}

	public void setAllRebate(BigDecimal allRebate) {
		this.allRebate = allRebate;
	}

	public BigDecimal getAllWithdrawRebate() {
		return allWithdrawRebate;
	}

	public void setAllWithdrawRebate(BigDecimal allWithdrawRebate) {
		this.allWithdrawRebate = allWithdrawRebate;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public BigDecimal getAllWaitWithdrawRebate() {
		return allWaitWithdrawRebate;
	}

	public void setAllWaitWithdrawRebate(BigDecimal allWaitWithdrawRebate) {
		this.allWaitWithdrawRebate = allWaitWithdrawRebate;
	}

	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public BigDecimal getOtherAmount() {
		return otherAmount;
	}

	public void setOtherAmount(BigDecimal otherAmount) {
		this.otherAmount = otherAmount;
	}

	public DistributorDetails getDistributorDetails() {
		return distributorDetails;
	}

	public void setDistributorDetails(DistributorDetails distributorDetails) {
		this.distributorDetails = distributorDetails;
	}

	public String getShopName() {
		return shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	public BigDecimal getOtherAllWaitWithdrawRebate() {
		return otherAllWaitWithdrawRebate;
	}

	public void setOtherAllWaitWithdrawRebate(BigDecimal otherAllWaitWithdrawRebate) {
		this.otherAllWaitWithdrawRebate = otherAllWaitWithdrawRebate;
	}

	public BigDecimal getOtherAllWithdrawRebate() {
		return otherAllWithdrawRebate;
	}

	public void setOtherAllWithdrawRebate(BigDecimal otherAllWithdrawRebate) {
		this.otherAllWithdrawRebate = otherAllWithdrawRebate;
	}

	public BigDecimal getAllAmount() {
		return allAmount;
	}

	public void setAllAmount(BigDecimal allAmount) {
		this.allAmount = allAmount;
	}

	public BigDecimal getAllKValue() {
		return allKValue;
	}

	public void setAllKValue(BigDecimal allKValue) {
		this.allKValue = allKValue;
	}

	public String getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(String beginDate) {
		this.beginDate = beginDate;
	}

	public String getEndDate() {
		return endDate;
	}

	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}
}